package com.xijia.proxy;

import com.xijia.proxy.jdk.MayiktInvocationHandler;
import com.xijia.proxy.service.OrderService;
import com.xijia.proxy.service.impl.OrderServiceImpl;


/**
 * 使用动态代理- 进行判断给标了异步注解的方法进行异步操作
 * @author wangsong
 * @mail 1720696548@qq.com
 * @date 2020/8/30 0030 20:55 
 * @version 1.0.0
 */
public class Test3 {
    public static void main(String[] args) {
        //
        OrderServiceImpl orderServiceImpl = new OrderServiceImpl();
        MayiktInvocationHandler mayiktInvocationHandler = new MayiktInvocationHandler(orderServiceImpl);
        // 使用Jdk生成代理对象
        OrderService orderServiceProxy = mayiktInvocationHandler.getProxy();
        // 将代理设置给目标对象
        orderServiceImpl.setOrderServiceProxy(orderServiceProxy);
        orderServiceProxy.addOrder();
    }
}
